<?php

class LogTransactionModel extends Model{
	
	protected $trueTableName = "log_transaction";
	
	static function ModifyInventory($uid,$order_no,$action,$msg){
		$ob = M('log_transaction');
		
		$a['uid'] = $uid;
		$a['order_no'] = $order_no;
		$a['action'] = $action;
		$a['msg'] = $msg;
		$a['admin'] = session('info.username');
		$a['session'] = session_id();
		
		$ob->add($a);
	}
	
	static function ModifyMoney($uid,$cid,$action,$before,$add,$after,$msg=""){
		$ob = M('log_money');
		
		$a['uid'] 		= $uid;
		$a['cid'] 		= $cid;
		$a['action'] 	= $action;
		$a['before'] 	= $before;
		$a['add'] 		= $add;
		$a['after'] 	= $after;
		$a['msg'] 		= $msg;
				
		$ob->add($a);
	}
}